package com.sunday.haowushop.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.sunday.haowushop.R;

import butterknife.ButterKnife;

/**
 * Created by 刘涛 on 2017/9/26.
 */

public class IndexTrialAdapter extends RecyclerView.Adapter {

    private Context mContext;
    private final static int TYPE_HEAD=0;
    private final static int TYPE_LIST=1;
    private LayoutInflater layoutInflater;



    public IndexTrialAdapter(Context context){
        this.mContext=context;
        layoutInflater=LayoutInflater.from(mContext);
    }


    @Override
    public int getItemViewType(int position) {
      return position==0?TYPE_HEAD:TYPE_LIST;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        switch (viewType){
            case TYPE_HEAD:
                View view= layoutInflater.inflate(R.layout.index_trial_head,null);
                return new HeadHolder(view);
            case TYPE_LIST:
                view=layoutInflater.inflate(R.layout.index_trial_list,null);
                return new ListHolder(view);
        }
        return null;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        switch (getItemViewType(position)){
            case TYPE_HEAD:
                break;
            case TYPE_LIST:
                break;
        }
    }

    @Override
    public int getItemCount() {
        return 0;
    }

    class HeadHolder extends RecyclerView.ViewHolder {


        public HeadHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }

    class ListHolder extends RecyclerView.ViewHolder {

        public ListHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }


}
